import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  // 服务
  server: {
    open: true,
    port: 8080,
    // 代理配置
    proxy: {
      '/api': {
        target: 'http://192.168.0.111:8899/contract-manage/',
        // target: 'http://192.168.0.113:8899/contract-manage/',
        rewrite: (path) => path.replace(/^\/api/, ''),
        changeOrigin: true
      }
    }
  },
  build: {
    // 打包后目录,默认dist
    // outDir: "dist",
  },
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src')
    }
  },
  css: {
    postcss: {
      plugins: [require('postcss-preset-env')]
    }
  }
})
